<template>
  <div class="lunBo">
    <div class="swiper" ref="floor1Swiper">
      <div class="swiper-wrapper ccsw">
        <div class="swiper-slide" v-for="(a, i) in lunbotu" :key="i">
          <img :src="a" alt="" />
        </div>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination4 swiper-pagination"></div>

      <!-- 如果需要导航按钮 -->
      <!-- <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div> -->

      <!-- 如果需要滚动条 -->
      <!-- <div class="swiper-scrollbar"></div> -->
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";
export default {
  data() {
    return {
      lunbotu: [
        "//imgcps.jd.com/ling4/10063027305758/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-60541365d250103053e030ee/a9cb2ba8/cr_1125x449_0_166/s/q70.jpg",
        "//m15.360buyimg.com/mobilecms/s1062x420_jfs/t1/159944/10/24807/123813/61db8b3cE235baed1/cb7cf5029afef5e3.jpg!cr_1053x420_4_0!q70.jpg",
        "//imgcps.jd.com/ling4/10063027305758/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-60541365d250103053e030ee/a9cb2ba8/cr_1125x449_0_166/s/q70.jpg",
        "//m15.360buyimg.com/mobilecms/s1062x420_jfs/t1/159944/10/24807/123813/61db8b3cE235baed1/cb7cf5029afef5e3.jpg!cr_1053x420_4_0!q70.jpg",
        "//imgcps.jd.com/ling4/10063027305758/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-60541365d250103053e030ee/a9cb2ba8/cr_1125x449_0_166/s/q70.jpg",
        "//m15.360buyimg.com/mobilecms/s1062x420_jfs/t1/159944/10/24807/123813/61db8b3cE235baed1/cb7cf5029afef5e3.jpg!cr_1053x420_4_0!q70.jpg",
        "//imgcps.jd.com/ling4/10063027305758/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-60541365d250103053e030ee/a9cb2ba8/cr_1125x449_0_166/s/q70.jpg",
        "//m15.360buyimg.com/mobilecms/s1062x420_jfs/t1/159944/10/24807/123813/61db8b3cE235baed1/cb7cf5029afef5e3.jpg!cr_1053x420_4_0!q70.jpg",
      ],
    };
  },

  watch: {
    lunbotu: {
      immediate: true,
      handler() {
        this.$nextTick(() => {
          new Swiper(this.$refs.floor1Swiper, {
            //direction: 'vertical', // 垂直切换选项
            loop: true, // 循环模式选项
            autoplay: true,

            // 如果需要分页器
            pagination: {
              el: ".swiper-pagination",
              clickable: true, //设置小原店面可以切换
            },

            // 如果需要前进后退按钮
            navigation: {
              nextEl: ".swiper-button-next",
              prevEl: ".swiper-button-prev",
            },

            // 如果需要滚动条
            scrollbar: {
              el: ".swiper-scrollbar",
            },
          });
        });
      },
    },
  },
};
</script>

<style>
.lunBo {
  width: 100%;
  height: 100%;
}
.swiper {
  width: 100%;
  height: 100%;
  position: relative;
  margin: auto;
}
</style>